Method of gathering statistics of gray distribution of image

ABSTRACT

A method of gathering statistics of gray distribution of an image in an image processing device is provided. The method includes determining gray information of a plurality of data of an input image, wherein each piece of information corresponds to a count value. In addition, a fixed value is sequentially added to the corresponding count value according to the gray information of the data. When the count value exceeds a predetermined value, the count value is reset and the gray distribution of the image is updated. The count value of each piece of gray information is accumulated and when the accumulated value exceeds a predetermined value, the gray distribution of the image is updated to simplify the flow of process of the method of gathering statistics of gray distribution of an image.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a divisional application of and claims the benefitof an U.S. application Ser. No. 12/267,612, filed on Nov. 9, 2008, nowpending, which claims the priority benefit of Taiwan application serialno. 97132436, filed on Aug. 25, 2008. The entirety of each of theabove-mentioned patent applications is hereby incorporated by referenceherein and made a part of this specification.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a technology of analyzing digitalimages and more particularly, to a method of gathering statistics ofgray distribution of images in an image processing device.

2. Description of Related Art

A gray histogram (abbreviated as GH) and a gray cumulative percentagegraph are important and indispensable information in image processing.In general, the gray histogram is obtained with a probabilitydistribution function (PDF) and the gray cumulative percentage graph isobtained with a cumulative distribution function (CDF). Furtherillustration on the gray histogram and the gray cumulative percentagegraph is provided below.

FIG. 1A is a conventional gray histogram. Referring to FIG. 1A, the grayhistogram may be used to determine gray distribution of images, whereinthe horizontal axis represents gray values and the vertical axisrepresents amount of data, i.e. the distribution of the amount of dataof each gray value. Take a normally black liquid crystal display as anexample. The closer the peak is to the right of the histogram, the morebright data there are and the brighter the entire image will appear. Incontrast, the closer the peak is to the left of the histogram, the moredark data there are and the darker the entire image will appear.

FIG. 1B is a conventional gray cumulative percentage graph. Referring toFIG. 1B, the gray cumulative percentage graph may also be used as a toolto determine gray distribution of images. The gray cumulative percentagegraph of FIG. 1B is similar to the gray histogram of FIG. 1A. Thedifference lies in that the horizontal axis of the gray cumulativepercentage graph represents gray values and the vertical axis representscumulative percentages, i.e. the cumulative percentage of each grayvalue of an image. For example, the gray value 200 illustrates acumulative percentage which is obtained by dividing the total number ofpixels in an image having a gray value under 200 by the total number ofpixels in the image.

FIG. 2A is a conventional circuit structure diagram of calculating CDFvalues. Referring to FIG. 2A, take a monochrome image of having 256 graylevels and a resolution of 1366×768 as an example. A comparing unit 101has 256 comparators, i.e. 101.0˜101.255. A count unit 103 has 256counters, i.e. 103.0˜103.255. A division unit 105 has 256 dividers, i.e.105.0˜105.255. An output unit 107 has 256 registers. i.e. 107.0-407.255.

First input terminals of the comparators 101.0-101.255 respectivelyreceive predetermined gray information “0” to “255.” Second inputterminals of the comparators 101.0˜101.255 are used to receive grayvalues of the various data in the image. In light of the above, when thegray values received by the second input terminals of the comparatorsare lower than or equal to the predetermined gray information of thefirst input terminals, the said comparators output a high level voltage.Otherwise, the comparators output a low level voltage.

More specifically, when the gray values received at the second inputterminals of the comparators 101.0˜101.255 are “50,” the comparators101.0˜101.50 all output a high level voltage and the comparators101.51˜101.255 will all output a low level voltage.

The counters 103.0˜103.255 respectively store a count value and mayclear the count values based on a clearing signal clear_1. When each ofthe counters receives a high level voltage “1,” the said counter willadd 1 to the count value stored therein according to a clock signalclk_1. The purpose is to keep a count of the amount of data of variousgray values in the input image. Furthermore, the counters 103.0˜103.255may respectively output the abovementioned amount of data to thedividers 105.0˜105.255. Next, the dividers 105.0˜105.255 respectivelydivide the received amount of data by the total amount of data“1,049,088” in the image. As such, a cumulative percentage of each grayvalue in the input image may be obtained. Finally, the registers107.0˜107.255 latch the output values from the dividers 105.0˜105.255and respectively output the CDF values of the gray values “0”˜“255”according to a clock signal clk_2.

It should be mentioned that the maximum limit of the possible amount ofdata of each gray value is 1366×768=1,049,088. Therefore, each of thecounters in the count unit 103 has to be a counter of 21 bits or more.That is, each counter requires at least 21 registers to implement. Inother words, the count unit 103 requires 256×21=5,376 registers.Furthermore, if gray cumulative percentage graphs of two input imagesare to be retained, the count unit 103 has to use 10,752 registers. Inaddition, the number of registers required by the count unit 103 riseswith the increase in the resolution or the number of gray levels of theinput image. In other words, the conventional circuit for calculatingCDF values applied in an image of high resolution or high number of graylevels often requires tremendous hardware costs and thus is not suitablefor practical use in products.

In light of the above, a conventional solution has been developed whichgathers statistics on a combination of gray values. FIG. 2B is anotherconventional circuit structure diagram of calculating CDF values. Take amonochrome image having 256 gray levels and a resolution of 1366×768 asan example again. FIG. 2B is similar to FIG. 2A with a difference inthat a comparing unit 201 has 128 comparators, i.e. 101.1, 101.3, . . ., 101.253, and 101.255. A count unit 203 has 128 counters, i.e. 103.1,103.3, . . . , 103.253, and 103.255. A division unit 205 has 128dividers, i.e. 105.1, 105.3, . . . , 105.253, and 105.255. An outputunit 207 has 128 registers, i.e. 107.1, 107.3, . . . , 107.253, and107.255.

An amount of data of gray value under “1” in an image may be obtainedthrough the comparator 101.1, the counter 103.1, the divider 105.1, andthe register 107.1. Similarly, an amount of data of gray value under “3”in an image may be obtained through the comparator 101.3, the counter103.3, the divider 105.3, and the register 107.3. Simply speaking, theapproach is to incorporate the calculation of the data of gray value “0”and “1,” the calculation of the data of gray value “2” and “3,” . . . ,and the calculation of the data of gray value “254” and “255.” As such,the number of counters used by the count unit 203 decreases to 128 andthe number of registers decreases to 2688. However, the approach mayonly obtain the total amount of data of two gray values and not theamount data of each individual gray value.

SUMMARY OF THE INVENTION

The present invention provides an image processing device of gatheringstatistics of gray distribution of an image. When a count valuecorresponding to each piece of gray information exceeds a predeterminedvalue, the gray distribution of the image is updated to reduce thenumber of registers used by the count unit and thus decrease hardwarecosts.

The present invention provides a method of gathering statistics of graydistribution of an image. The count value of each piece of grayinformation is accumulated and when the accumulated value exceeds apredetermined value, the gray distribution of the image is updated tosimplify the flow of process of the method of gathering statistics ofgray distribution of an image.

The present invention provides an image processing device of gatheringstatistics of gray distribution of an image. The image processing deviceof gathering statistics of gray distribution of an image includes acomparing unit, a count unit, a memory unit, and a data allotment unit.The comparing unit is used to determine gray information of a pluralityof data of an image, based on which, the comparing unit outputs acorresponding count signal. The count unit is coupled to the comparingunit.

The count unit has a plurality of counters and each of the counterscorresponds to predetermined gray information and has a count value.Each of the counters updates the count value according to thecorresponding count signal. When the count value exceeds a predeterminedvalue, the count unit outputs a pulse signal of the gray informationcorresponding to the count value. The memory unit is used to store thegray distribution of an image. The data allotment unit is coupled to thecount unit and the memory unit and updates the gray distribution of animage in the memory unit according to the received pulse signal.

In one embodiment of the present invention, the comparing unit has aplurality of comparators. Each comparator respectively receives thepredetermined gray information corresponding to each counter. Eachcomparator is used to respectively compare the data of the input imagewith the predetermined gray information to determine the grayinformation of each data of the input image.

In one embodiment of the present invention, the count unit furtherincludes a plurality of pulse generators. Each pulse generator isrespectively coupled to each counter. When one of the plurality of countvalues exceeds the predetermined value, the corresponding counteroutputs an overflow signal to the pulse generator to cause the pulsegenerator to output a pulse signal.

In one embodiment of the present invention, the pulse generatorrespectively includes a first D flip-flop, a second D flip-flop, a NOTgate, an AND gate, and a third D flip-flop. The first D flip-flop iscoupled to the counter, receives the overflow signal, and outputs theoverflow signal according to a first clock signal. An input terminal ofthe second D flip-flop is coupled to an output terminal of the first Dflip-flop. The second D flip-flop may output the overflow signalaccording to the signal output from the first D flip-flop. An inputterminal of the NOT gate is coupled to the output terminal of the firstD flip-flop. A first input terminal and a second input terminal of theAND gate are respectively coupled to an output terminal of the second Dflip-flop and an output terminal of the NOT gate to generate the pulsesignal. The third D flip-flop is coupled to an output terminal of theAND gate and outputs the pulse signal according to a second clocksignal.

In one embodiment of the present invention, the data allotment unitincludes a distributor, a delayer, a control unit, and a feedbackcircuit. The distributor is coupled to the count unit and provides fixedaddress information and a read signal according to the pulse signal. Thedelayer is coupled to the distributor, and used to delay the read signalso as to generate a write signal. The control unit is coupled to thedistributor and the delayer and causes the memory unit to output thegray statistics of the gray distribution of the image according to thefixed address information and the read signal. The feedback circuit iscoupled to the memory unit and the control unit, and used to update thegray statistics and to send back the updated gray statistics to thecontrol unit. The control unit then writes the updated gray statisticsinto the memory unit according to the write signal. In anotherembodiment, the feedback circuit includes an adder. The adder is coupledto the memory unit and the control unit, and used to add a fixed valueto the gray statistics output from the memory unit and send the addedvalue back to the control unit.

In one embodiment of the present invention, the memory unit includes aplurality of sub memory units. Each sub memory unit is used to retain agray distribution of an input image. In another embodiment, each counterand each memory unit respectively has a receiving terminal for aclearing signal. When each counter receives a clearing signal, thecounter resets the count value. When the memory unit receives theclearing signal, the memory unit resets the gray distribution of theimage.

From another perspective, the present invention provides a method ofgathering statistics of gray distribution of an image. The methodincludes determining gray information of a plurality of data of an inputimage, wherein each piece of information corresponds to a count value.In addition, a fixed value is sequentially added to the correspondingcount value according to the gray information of the data. When thecount value exceeds a predetermined value, the count value is reset andthe gray distribution of the image is updated.

In one embodiment of the present invention, the method of gatheringstatistics of gray distribution of an image further includes resettingeach count value and gray distribution of an image. In anotherembodiment, after the step of updating the gray distribution of theimage, the method further includes a period, in which the graydistribution of the input image and a next image of the input image aredisplayed together.

The present invention may reduce the number of registers and thusdecrease the hardware costs of the image processing device of gatheringstatistics of gray distribution of an image by adopting the approach ofupdating the gray distribution of an image after the count valueaccumulating each piece of gray information exceeds a predeterminedvalue.

In order to make the aforementioned and other objects, features andadvantages of the present invention more comprehensible, severalembodiments accompanied with figures are described in detail below.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings are included to provide a furtherunderstanding of the invention, and are incorporated in and constitute apart of this specification. The drawings illustrate embodiments of theinvention and, together with the description, serve to explain theprinciples of the invention.

FIG. 1A is a conventional gray histogram.

FIG. 1B is a conventional gray cumulative percentage graph.

FIG. 2A is a conventional circuit structure diagram of calculating CDFvalues.

FIG. 2B is another conventional circuit structure diagram of calculatingCDF values.

FIG. 3 is a schematic diagram of an image processing device of gatheringstatistics of gray distribution of an image according to a firstembodiment of the present invention.

FIG. 4A is a circuit diagram of a pulse generator according to the firstembodiment of the present invention.

FIG. 4B is a timing diagram of internal signals in a pulse generatoraccording to the first embodiment of the present invention.

FIG. 5 is a flow chart of a method of gathering statistics of graydistribution of an image according to the first embodiment of thepresent invention.

FIG. 6 is a schematic diagram of an image processing device of gatheringstatistics of gray distribution of an image according to a secondembodiment of the present invention.

DESCRIPTION OF EMBODIMENTS The First Embodiment

FIG. 3 is a schematic diagram of an image processing device of gatheringstatistics of gray distribution of an image according to the firstembodiment of the present invention. Referring to FIG. 3, an imageprocessing device 10 of gathering statistics of gray distribution of animage includes a comparing unit 20, a count unit 30, a memory unit 50,and a data allotment unit 40. Take a monochrome image having 256 graylevels and a resolution of 1366×768 as an example. The comparing unit 20is used to determine gray information of each of a plurality of data inan image, based on which, the comparing unit 20 outputs a correspondingcount signal CS. More specifically, the comparing unit 20 has aplurality of comparators (shown as 20.0˜20.255). The comparators20.0˜20.255 respectively receive predetermined gray information“0”˜“255” and each of the input image data. The comparators 20.0˜20.255are used to respectively compare the gray value of each input image datawith the predetermined gray information “0”˜“255” so as to determine thegray information of each input image data. For example, when the grayvalue of the image data is “30,” only the comparator 20.30 will output ahigh level voltage count signal CS. The comparators 20.0˜20.29 and20.31˜20.255 will output low level voltage count signals CS.

The count unit 30 is coupled to the comparing unit 20. The count unit 30has a plurality of counters (shown as 30.0˜30.255) and a plurality ofpulse generators (shown as 31.0˜31.255). The counters 30.0˜30.255respectively correspond to predetermined gray information “0”˜“255” andrespectively store a count value. The counters 30.0˜30.255 respectivelyupdate the count values according to the count signals CS output fromthe comparators 20.0˜20.255. When the count value exceeds thepredetermined value, each counter outputs an overflow signal FS of thecorresponding gray information according to a clock signal clk_3. Thecounters 30.0˜30.255 in the present embodiment use counters of 2 bits asan example for the purpose of illustration. The counters 30.0˜30.255respectively comprise two registers and can count from 0 to 3. However,the present invention does not limit the number of bits of the counters.The counters 30.0˜30.255 are implemented with counters of other numberof bits in other embodiments.

From the above, the pulse generators 31.0˜31.255 are respectivelycoupled to the counters 30.0˜30.255. The pulse generators 31.0˜31.255generate corresponding pulse signals PS according to the overflowsignals FS output from the counters 30.0˜30.255 and a clock signalclk_4. The pulse signals PS generated by the pulse generators31.0˜31.255 respectively correspond to the predetermined grayinformation “0”˜“255”.

On the other hand, the data allotment unit 40 is coupled to the countunit 30 and the memory unit 50. The data allotment unit 40 may updatethe gray distribution of the image in the memory unit 50 according tothe pulse signals PS generated in the pulse generators 31.0˜31.255. Forexample, the data allotment unit 40 includes a distributor 44, a delayer60, a control unit 70, and a feedback circuit 80. The distributor 44 iscoupled to the pulse generators 31.0˜31.255 and the delayer 60. Thecontrol unit 70 is coupled to the distributor 44, the delayer 60, andthe feedback circuit 80. The feedback circuit 80 is coupled to thememory unit 50.

The distributor 44 may provide fixed address information ADIF and a readsignal RS according to the received pulse signal PS. The delayer 60 isused to delay the read signal RS and generate a write signal WSaccording a clock signal clk_5. The control unit 70 makes the memoryunit 50 output a gray statistics of the gray distribution of the imagecorresponding to the fixed address information ADIF to the feedbackcircuit 80 according to the fixed address information ADIF and the readsignal RS.

The feedback circuit 80 is used to update the gray statistics. Thefeedback circuit 80 includes an adder 90, for example. The adder 90 addsa fixed value to the gray statistics output from the memory unit 50, andsends the added result back to the control unit 70. The control unit 70then sequentially writes the updated gray statistics into the memoryunit 50 according to the write signal WS. In the present embodiment, theabovementioned fixed value is 1, for example. An implementation of apulse generator is illustrated below for reference by persons skilled inthe art.

FIG. 4A is a circuit diagram of the pulse generator according to thefirst embodiment of the present invention. FIG. 4B is a timing diagramof internal signals in a pulse generator according to the firstembodiment of the present invention. Referring to both FIG. 4A and FIG.4B, in the present embodiment, the pulse generators 31.0˜31.255 mayrespectively include D flip-flops 311˜313, a NOT gate 314, and an ANDgate 315, for example. The D flip-flop 311 is used to receive theoverflow signal FS and output an overflow signal S1 according to theclock signal clk_4. The NOT gate 314 is used to convert the state of theoverflow signal Si to generate an overflow signal S3 for the AND gate315. The D flip-flop 312 receives the overflow signal Si and outputs anoverflow signal S2 for the AND gate 315 according to the clock signalclk_4. The AND gate 315 respectively receives the overflow signals S2and S3 to generate a pulse signal PS′ for the D flip-flop 313. The Dflip-flop 313 may output the pulse signal PS according to a clock signalclk_6.

FIG. 5 is a flow chart of a method of gathering statistics of graydistribution of an image according to the first embodiment of thepresent invention. Referring to both FIG. 3 and FIG. 5, take amonochrome image having 256 gray levels and a resolution of 1366×768 asan example again. First, at step S501, before gathering statistics ofgray distribution of each input image, a clearing signal clear_2 may beused to reset the count values of the counters 30.0˜30.255 to reset allthe count values to be 0. In addition, the clearing signal clear_2 maybe transmitted to the control unit 70 to reset the gray distribution ofthe image in the memory unit 50 so that the gray statistics of graydistribution of the image are all reset to be 0. In the presentembodiment, the clearing signal clear_2 may be implemented with a framesignal, for example.

Next, at step S502, the comparing unit 20 determines the input grayinformation of each data of the input image. Furthermore, the counters30.0˜30.255 update the count values stored therein according to theinput gray information of step S502 so as to count the amount of datacorresponding to each piece of gray information (step S503). Suppose thegray values of the first five data data_1˜data_5 of the input image arerespectively “30,” “25,” “30,” “30,” and “30.” When the data data_1 isoutput to the comparators 20.0˜20.255, only the comparator 20.30 willoutput a high level voltage count signal CS and the comparators20.0˜20.29 and 20.31˜20.255 will output low level voltage count signalsCS. Therefore, the counter 30.30 will add a fixed value (1 as an examplein the present embodiment) to the count value stored therein to changethe count value in the counter 30.30 from 0 to 1.

Similarly, when the data data_2 (of gray value “25”) is output to thecomparators 20.0˜20.255, the count value of the counter 30.25 will bechanged from 0 to 1. When the data data_3 (of gray value “30”) is outputto the comparators 20.0˜20.255, the count value of the counter 30.30will be changed from 1 to 2. When the data data_4 (of gray value “30”)is output to the comparators 20.0˜20.255, the count value of the counter30.30 will be changed from 2 to 3.

It should be noted that when the count value of one of the counters30.0˜30.255 reaches a predetermined value, the count value of thecorresponding counter may be reset and the gray distribution of theimage may be updated (step S504). In the present embodiment, thepredetermined value is 3 for the purpose of illustration, which is notlimited by the present invention and persons skilled in the art maydefine other values based on requirements in other embodiments.Furthermore, the counters 30.0˜30.255 respectively include two registersand thus may only count from 0 to 3. Continuing with the abovedescription, when the data data_5 (of gray value “30”) is input to thecomparators 20.0˜20.255, the counter 30.30 will add 1 to the countvalue. The count value of the counter 30.30 changes from 3 to 0 and thecounter 30.30 generates the overflow signal FS to the pulse generator31.30.

The pulse generator 31.30 then generates the pulse signal PS to thedistributor 44. The predetermined gray information corresponding to thepulse signal PS generated by the pulse generator 31.30 is “30” so thedistributor 44 outputs the read signal RS and the fixed addressinformation ADIF corresponding to the gray information “30” to thecontrol unit 70 according to the pulse signal PS. The control unit 70then controls the memory unit 50 to output the gray statisticscorresponding to the gray information “30” to the feedback circuit 80according to the read signal RS and the fixed address information ADIF.Next, the feedback circuit 80 adds 1 to the gray statisticscorresponding to the gray information “30” so that the gray statisticscorresponding to the gray information “30” changes from 0 to 1. Thefeedback circuit 80 then sends the gray statistics corresponding to thegray information “30” (i.e. 1) back to the control unit 70.

In another aspect, the delayer 60 delays the read signal RS by the clocksignal clk_5 of a clock cycle so as to generate the write signal WS tothe control unit 70. The control unit 70 then may write the graystatistics corresponding to the gray information “30” (i.e. 1) into thememory unit 50 according to the write signal WS and the fixed addressinformation ADIF. Accordingly, the step of updating the graydistribution of the image in the memory unit 50 is completed. Similarly,the count unit 30 may be continuingly used to count the amount of dataof each piece of gray information.

When the count value exceeds 3, the control unit 70 is used to updatethe gray distribution of the image stored in the memory unit 50. In thepresent embodiment, each time when the gray statistics of the graydistribution of the image is increased by 1, it means that the amount ofdata of the corresponding gray information is increased by 4.

It should be mentioned that the fixed value added by the abovementionedadder 90 is 1 for the purpose of illustration. However, persons skilledin the art may change the fixed value added by the adder 90 to be othervalues based on requirements. For example, the fixed value added by theadder 90 may be changed to 4. Then, the gray statistics of the graydistribution of the image represents the amount of data of the grayinformation.

Referring to FIG. 2A again, in the above embodiment, the analysis of thegray distribution of the input image takes a period of time, resultingin that the input image and the gray distribution of the input image cannot be displayed synchronously. Because of the minor differences amongimages that are continuous, the gray distribution of an image has asignificant reference value for the next image. Therefore, personsskilled in the art may display the gray distribution of an imagetogether with the next image so as to improve the problem that the inputimage and the gray distribution of the input image can not be displayedsynchronously.

In summary, the present embodiment uses the count unit 30 to count theamount of data of each piece of gray information. When the amount ofdata exceeds a predetermined value, the gray distribution of an image isthen updated. Therefore, it is not required to update the graydistribution of an image each time a data is received so the flow ofprocess of gathering statistics of the gray distribution of an image issimplified in the present embodiment. In addition to the aforesaid, thecounters 30.0˜30.255 are 2 bit counters so each counter respectivelyrequires 2 registers for implementation. In contrast, the conventionalcounters are 21 bit counters so each counter requires 21 registers forimplementation. Compared with conventional technology, the presentembodiment reduces the number of registers and thus greatly decreaseshardware costs.

It should be noted that an image processing device of gatheringstatistics of gray distribution of an image and method thereof have beengenerally narrated in the above embodiment, whilst people skilled in thepertinent art should be aware that different manufacturers aim atdesigning distinctive image processing devices of gathering statisticsof gray distribution of an image and methods thereof. Hence, theapplication of the present invention should not be limited to theembodiment provided hereinbefore. In other words, any image processingdevice of gathering statistics of gray distribution of an image andmethod thereof that accumulates count values of gray information andupdates the gray distribution of an image when the accumulated valuesexceed a predetermined value falls within the spirit of the presentinvention. Another embodiment is further discussed hereinafter to allowpersons skilled in the art to further comprehend and implement thepresent invention.

The Second Embodiment

FIG. 6 is a schematic diagram of an image processing device of gatheringstatistics of gray distribution of an image according to the secondembodiment of the present invention. Referring to both FIG. 3 and FIG.6, an image processing device 11 of gathering statistics of graydistribution of an image in FIG. 6 is similar to the image processingdevice 10 of gathering statistics of gray distribution of an image inFIG. 3. In FIG. 6, implementation of components whose reference numeralsare the same as the components in the above embodiment may be directedto the above description. It should be noted that a memory unit 51 ofthe present embodiment includes sub memory units 52 and 53. In addition,a data allotment unit 41 further includes a feedback circuit 81. Whengathering statistics of the gray distribution of a first input image, acontrol unit 71 may reset the gray distribution of the image in the submemory unit 52. Next, the control unit 71 may store the graydistribution of the first input image in the sub memory unit 52 and usesa feedback circuit 80 to update the gray distribution of the imagestored in the sub memory unit 52.

When gathering statistics of the gray distribution of a second inputimage, the control unit 71 may reset the gray distribution of the imagein the sub memory unit 53. Next, the control unit 71 may store the graydistribution of the second input image in the sub memory unit 53 anduses the feedback circuit 81 to update the gray distribution of theimage stored in the sub memory unit 53. Therefore, when gathering thestatistics of the gray distribution of the second input image, the graydistribution of the first input image is still stored in the sub memoryunit 52 and is not lost. As such, the image processing device 11 ofgathering statistics of gray distribution of an image may simultaneouslyretain the gray distributions of two input images.

Compared with conventional technology, the present embodiment requiresmerely an additional sub memory unit to store an additional graydistribution of an image. On the other hand, the implementation of thecount unit of the conventional technology requires twice of the numberof registers to simultaneously retain the gray distributions of twoinput images. Therefore, the present embodiment achieves the sameeffects as the above embodiment and may simultaneously retain the graydistributions of two input images without tremendous hardware costs.

In summary, the present invention reduces the number of registers andthus decreases the hardware costs of the image processing device ofgathering statistics of gray distribution of an image by adopting theapproach of updating the gray distribution of an image after the countvalue accumulating each piece of gray information exceeds apredetermined value. Moreover, the embodiments of the present inventionhave at least the following advantages:

1. The count unit is used to count the amount of data of each piece ofgray information. When the amount of data exceeds a predetermined value,the gray distribution of an image is then updated. Therefore, it is notrequired to update the gray distribution of an image each time a data isreceived so the flow of process of gathering statistics of the graydistribution of an image is simplified.

2. The counters in the embodiments of the present invention are 2 bitcounters so each counter respectively requires only 2 registers forimplementation. In contrast, the conventional counters are 21 bitcounters so each counter requires 21 registers for implementation.Compared with conventional technology, the embodiments of the presentinvention reduce the number of registers and thus greatly decreasehardware costs.

3. Compared with conventional technology, the embodiments of the presentinvention require merely an additional sub memory unit to store anadditional gray distribution of an image. On the other hand, theimplementation of the count unit of the conventional technology requirestwice of the number of registers to simultaneously retain the graydistributions of two input images. Therefore, the present embodiment maysimultaneously retain gray distributions of two input images withouttremendous hardware costs.

It will be apparent to those skilled in the art that variousmodifications and variations can be made to the structure of the presentinvention without departing from the scope or spirit of the invention.In view of the foregoing, it is intended that the present inventioncover modifications and variations of this invention provided that theyfall within the scope of the following claims and their equivalents.

What is claimed is:
 1. A method of gathering statistics of graydistribution of an image in an image processing device, comprising:determining gray information of a plurality of data of an input image bya comparing unit in the image processing device, wherein each piece ofgray information corresponds to a count value; sequentially adding afixed value to the corresponding count value according to the grayinformation of each of the data by a plurality of counters in a countunit in the image processing device; and resetting the count value andupdating the gray distribution of the image when the count value exceedsa predetermined value by a data allotment unit in the image processingdevice.
 2. The method of gathering statistics of gray distribution of animage according to claim 1, further comprising: resetting each of thecount values and the gray distribution of the image.
 3. The method ofgathering statistics of gray distribution of an image according to claim1, wherein after the step updating the gray distribution of the imagefurther comprising: in a period, displaying the gray distribution of theinput image together with a next image of the input image.